package com.lhk.springbootmongodb.service.impl;

import com.lhk.springbootmongodb.mapper.CommentMapper;
import com.lhk.springbootmongodb.service.CommentService;
import com.lhk.springbootmongodb.entity.Comment;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.List;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<Comment> findAll() {
        return commentMapper.findAll();
    }

    @Override
    public void insert(Comment comment) {
        commentMapper.insert(comment);
    }

    @Override
    public void save(Comment comment) {
        commentMapper.save(comment);
    }

    @Override
    public void del(String id) {
        commentMapper.deleteById(id);
    }
}
